<!-- 我的钱包 -->
<template>
	<view class="wallet-page">
		<image class="price-icon" src="@/static/images/icons/price.png"></image>
		<view class="price-title">
			总金额
		</view>
		<view class="price-num">
			<text>¥</text>
			<text>{{balance}}</text>
		</view>
		<view class="tool">
			<text @click="goWithdrawList()">提现记录</text>
			<text>｜</text>
			<text @click="goBillList()">账单明细</text>
		</view>
		<view class="button" @click="goWithdraw()">
			提现
		</view>
	</view>
</template>

<script>
	import {
		mapState,
		mapActions,
		mapGetters
	} from 'vuex';
	export default {
		components: {},
		data() {
			return {
				isEmpty: false,
				stateCurrent: 'all', //默认
				showMoney: true,
				balance:0
			};
		},
		computed: {
			...mapGetters(['isLogin', 'userInfo'])
		},
		onShow() {
			this.isLogin && this.getUserInfo();
			this.getToday();
		},
		methods: {
			...mapActions(['getUserInfo']),
			//  获取余额
			getToday() {
				let that = this;
				that.$http_business('money.balanceData').then(res => {
					if (res.code == 1) {
						that.balance = res.data.money;
					}
				});
			},
			// 路由跳转
			jump(path, parmas) {
				this.$Router.push({
					path: path,
					query: parmas
				});
			},
			goWithdraw(){
				this.jump('/pages/user/wallet/withdraw');
			},
			goWithdrawList(){
				this.jump('/pages/user/wallet/withdrawList');
			},
			goBillList(){
				this.jump('/pages/user/wallet/billListNew');
			}
		}
	};
</script>

<style lang="scss">
	page{
		background-color: #fff;
		text-align: center;
	}
	.price-icon{
		width: 190rpx;
		height: 190rpx;
		margin: 150rpx auto 0 auto;
	}
	.price-title{
		font-size: 26rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #666666;
		margin-top: 30rpx;
	}
	.price-num{
		padding: 20rpx 0;
	}
	.price-num text:first-child{
		font-size: 40rpx;
		font-family: PingFangSC-Semibold, PingFang SC;
		font-weight: 600;
		color: #222222;
	}
	.price-num text:last-child{
		font-size: 80rpx;
		font-family: PingFangSC-Semibold, PingFang SC;
		font-weight: 600;
		color: #222222;
	}
	.tool{
		font-size: 26rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #FC5351;
	}
	.button{
		margin: 120rpx auto 0 auto;
		font-size: 30rpx;
		font-family: PingFangSC-Regular, PingFang SC;
		font-weight: 400;
		color: #FFFFFF;
		width: 240rpx;
		height: 80rpx;
		line-height: 80rpx;
		background: #FC5351;
		border-radius: 44rpx;
	}
</style>
